package com.woniuxy.educationplatform.mapper;

import com.woniuxy.educationplatform.bean.QuesBean;
import com.woniuxy.educationplatform.bean.QuesType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Mapper
public interface QuesTypeMapper {
    /**
     * 查询所有题型
     * @return
     */
    @Results({
            @Result(id = true, property = "id", column = "id", javaType = Integer.class),
            @Result(property = "name", column = "name", javaType = String.class)
    })
    @Select("select * from ques_type")
    List<QuesType> findAll();

    /**
     * 根据ID查询题型
     * @param id
     * @return
     */
    @Results({
            @Result(id = true, property = "id", column = "id", javaType = Integer.class),
            @Result(property = "name", column = "name", javaType = String.class)
    })
    @Select("select * from ques_type where id = #{id}")
    QuesType getOneById(Long id);
}
